#ifndef CHATCONTROLLER_H
#define CHATCONTROLLER_H

#include <QObject>
#include "messagemodel.h"
#include "chatclient.h"
#include "chataudio.h"

class ChatController : public QObject
{
    Q_OBJECT

    Q_PROPERTY(MessageModel *messageModel READ messageModel CONSTANT)
    Q_PROPERTY(ChatAudio *chatAudio READ chatAudio CONSTANT)
public:
    explicit ChatController(QObject *parent = nullptr);

    MessageModel *messageModel();
    ChatAudio *chatAudio();

signals:

public slots:
    void onTextMessageReceived(QString message);
    void onAudioInputStateChanged(QAudio::State audioState);
    void onAudioOutputStateChanged(QAudio::State audioState);
    //input输入消息
    Q_INVOKABLE void inputMessageSend(QString message);


private:

    MessageModel *m_messageModel;
    ChatClient *m_chatClient;
    ChatAudio *m_chatAudio;
};

#endif // CHATCONTROLLER_H
